package com.sq.partner.manager.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sq.partner.manager.dao.ActirationCardReportDao;
import com.sq.partner.manager.mybatis.model.ActirationCardDifinition;
import com.sq.partner.manager.mybatis.model.ActirationCardReport;
import com.sq.partner.manager.service.ActirationCardReportService;
import com.sq.partner.manager.util.Page;

/**
 *
 * @author zsm 2018年7月24日
 *
 */
@Service
public class ActirationCardReportServiceImpl implements ActirationCardReportService {
	@Resource
	private ActirationCardReportDao actirationCardReportDao;
	@Override
	public Page<ActirationCardDifinition> queryCardInfoForReport(
			Page<ActirationCardDifinition> page) throws Exception {
		page.setData(actirationCardReportDao.queryForCardReportPage(page.getMap()));
		page.setTotal(actirationCardReportDao.queryForCardReportCount(page.getMap()));
		return page;
	}
	@Override
	public List<ActirationCardReport> queryDataForReportExcels(
			Map<String, Object> map) throws Exception {
		
		return actirationCardReportDao.queryDataForReportExcel(map);
	}
	// 获取下级机构的数据 添加注释 lfd added 20181102
	@Override
	public Page<ActirationCardReport> queryList(
			Page<ActirationCardReport> page) throws Exception {
		page.setData(actirationCardReportDao.queryPageForDetail(page.getMap()));
		page.setTotal(actirationCardReportDao.queryCountForDetail(page.getMap()));
		return page;
	}
	// 获取本级机构的数据 添加注释 lfd added 20181102
	@Override
	public Page<ActirationCardReport> queryPage(Page<ActirationCardReport> page)
			throws Exception {
		page.setData(actirationCardReportDao.queryDataPage(page.getMap()));
		page.setTotal(actirationCardReportDao.queryDataCount(page.getMap()));
		return page;
	}
}
